/******************************************************************************
 *
 * Copyright (c) 2003-2004 PalmSource, Inc. All rights reserved.
 *
 * File: exception
 *
 * Release:
 *
 * Description:
 *
 *
 *****************************************************************************/


#ifndef __PALMSOURCE_CC_HDR_EXCEPTION
#define __PALMSOURCE_CC_HDR_EXCEPTION

/* Note: this header is incomplete */

#ifdef __EXCEPTIONS
#define __THROW(x) throw(x)
#define __NOTHROW() throw()
#else
#define __THROW(x)
#define __NOTHROW()
#endif

namespace std {
	class exception {
	public:
		exception() __NOTHROW();
		exception(const exception&) __NOTHROW();
		exception& operator=(const exception&) __NOTHROW();
		virtual ~exception() __NOTHROW();
		virtual const char* what() const __NOTHROW();
	};

	class bad_exception : public exception {
	public:
		bad_exception() __NOTHROW();
		bad_exception(const bad_exception&) __NOTHROW();
		bad_exception& operator=(const bad_exception&) __NOTHROW();
		virtual ~bad_exception() __NOTHROW();
		virtual const char* what() const __NOTHROW();
	};

	typedef void (*unexpected_handler)();
	unexpected_handler set_unexpected(unexpected_handler f) __NOTHROW();
	void unexpected();

	typedef void (*terminate_handler)();
	terminate_handler set_terminate(terminate_handler f) __NOTHROW();
	void terminate();

	bool uncaught_exception();
}

#endif /* __PALMSOURCE_CC_HDR_EXCEPTION */
